package io.renren.modules.app.dao;

import io.renren.modules.app.entity.TradeRecordingEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigDecimal;

/**
 * 交易记录表
 *
 * @date 2022-04-20 22:37:44
 */
@Mapper
public interface TradeRecordingDao extends BaseMapper<TradeRecordingEntity> {

    /**
     * 统计用户交易金额
     *
     * @param userId    用户id
     * @param tradeType 交易类型(0充值、1提现，2下级返佣)
     * @return
     */
    public BigDecimal statisticsUserTrade(Long userId, Integer tradeType);

}
